﻿using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel;
using SqlSugar;

namespace MQTT.Server.DataBase
{
    /// <summary>
    /// 用户
    /// </summary>
	[SugarTable("rbac_user", TableDescription = "用户信息表")]
    [SugarIndex("uk_rbac_user_username", nameof(UserName), OrderByType.Asc, true)]
    public class UserEntity 
    {
        [SugarColumn(CreateTableFieldSort = 1, IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "主键Id")]
        public long Id { get; set; }
        /// <summary>
        /// 账号
        /// </summary>
        [SugarColumn(ColumnDescription = "账号")]
        public string UserName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [SugarColumn(ColumnDescription = "密码")]
        public string Password { get; set; }

        /// <summary>
        /// 昵称
        /// </summary>
        [SugarColumn(ColumnDescription = "昵称",IsNullable = true)]
        public string NickName { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        [SugarColumn(ColumnDescription = "头像", IsNullable = true)]
        public string Avatar { get; set; }



        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDescription = "备注", IsNullable = true)]
        public string Remark { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        [SugarColumn(ColumnDescription = "是否删除", IsNullable = false)]
        public bool IsDeleted { get; set; } = false;
    }
}
